<template>
  <el-card>
    <div slot="header">
      <span>编辑菜单</span>
      <el-button @click="goBack" style="float: right" size="small">返回</el-button>
    </div>
    <MenuCreateOrUpdate :id="$route.params.id" @suc="onSuc"  />
  </el-card>
</template>
<script lang="ts">
import Vue from 'vue'
import MenuCreateOrUpdate from './components/createOrUpdate.vue'
export default Vue.extend({
  name: 'menu-create',
  components: {
    MenuCreateOrUpdate
  },
  methods: {
    onSuc () {
      this.$message.success('编辑成功')
      this.goBack()
    },
    goBack () {
      this.$router.push({ name: 'menu' })
    }
  }
})
</script>
